import axios from '../../http/http'

const store = {
    namespaced: true,
    state(){
        return {
            sortList: []
        }
    },
    actions: {
        sortListActions({commit}){
            axios.get("/catelist?istree=1").then(
                res=>{
                    if(res.status == 200){
                        commit('sortListMutations',res.data.list)
                    }
                    
                }
            )
        }
    },
    mutations: {
        sortListMutations(state,list){
            state.sortList = list
        }
    }
}

export default store